#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1e6 + 5;

int n, m;
bool vis[N];
int mnp[N];
int ans[N];
void init(int n) {
  vis[1] = 1;
  for (ll i = 2; i <= n; i++) {
    if (!vis[i]) {
      mnp[i] = i;
      for (ll j = i * i; j <= n; j += i) {
        if (!vis[j]) {
          mnp[j] = i;
          vis[j] = 1;
        }
      }
    }
  }
  ans[1] = 1;
  for (int i = 2; i <= n; i++) {
    int x = i;
    int k = 0;
    while (x % mnp[i] == 0) x /= mnp[i], k++;
    ans[i] = (k + 1) * ans[x];
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  init(n);
  rep(i, 1, n) cout << i << ' ' << ans[i] << endl;
  return 0;
}